1. /* sdcmpi4.cpp by K.Tsuru */
  2. // function ID 3550 DRADIX, constant
  3. /********************************
  4. SDouble class
  5. pi/4
  6. Used in Atan(), etc.
  7. *********************************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. static SDouble* mpi4 = NULL; //keep in the static memory
  12. static uint mpi4_size = 0;
  13. void MPi4Free(){ //free the memory of mpi4
  14. if(mpi4_size == 0) return;
  15. delete mpi4; mpi4 = NULL; mpi4_size = 0;
  16. }
  17. /* pi/4 */
  18. SDouble MPi4(){
  19. uint ms = SNManager::SNMaxSize(SNManager::REAL);
  20. if(mpi4_size < ms){
  21. if(mpi4 == NULL) mpi4 = new SDouble;
  22. SDouble pi;
  23. pi = Pi();
  24. *mpi4 = DsDiv(pi, 4uL); // pi/4
  25. mpi4_size = ms;
  26. }
  27. return *mpi4;
  28. }

sdcmpi4.cpp : last modifiled at 2017/06/23 10:17:11(689 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).